<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:v="clr-namespace:Microsoft.SDK.Samples.VistaBridge.Controls"
    >
  <Style x:Key="BackButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <StackPanel>
            <Canvas Background="Red">
              <Image Width="29" Height="26" Name="LeftBackButtonDisabled" Source="pack://application:,,/VistaBridgeControls;component/Images/BackButtons/LeftBackButtonDisabled.png" Opacity="1"/>
              <Image Width="29" Height="26" Name="LeftBackButtonEnabled" Source="pack://application:,,/VistaBridgeControls;component/Images/BackButtons/LeftBackButtonEnabled.png" Opacity="0"/>
              <Image Width="29" Height="26" Name="LeftBackButtonHover" Source="pack://application:,,/VistaBridgeControls;component/Images/BackButtons/LeftBackButtonHover.png" Opacity="0"/>
              <Image Width="29" Height="26" Name="LeftBackButtonPressed" Source="pack://application:,,/VistaBridgeControls;component/Images/BackButtons/LeftBackButtonPressed.png" Opacity="0"/>
            </Canvas>
          </StackPanel>
          <ControlTemplate.Triggers>
            <Trigger Value="True" Property="IsEnabled">
              <Setter Property="Opacity" Value="1" TargetName="LeftBackButtonEnabled"/>
            </Trigger>
            <EventTrigger RoutedEvent="Button.MouseEnter">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard Storyboard.TargetName="LeftBackButtonHover" Storyboard.TargetProperty="Opacity">
                    <DoubleAnimation To="1" Duration="0:0:0.5"/>
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="Button.MouseLeave">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard Storyboard.TargetName="LeftBackButtonHover" Storyboard.TargetProperty="Opacity">
                    <DoubleAnimation To="0" Duration="0:0:0.5"/>
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="Button.PreviewMouseLeftButtonDown">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard Storyboard.TargetName="LeftBackButtonPressed" Storyboard.TargetProperty="Opacity">
                    <DoubleAnimation To="1" Duration="0:0:0.2"/>
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="Button.PreviewMouseLeftButtonUp">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard Storyboard.TargetName="LeftBackButtonPressed" Storyboard.TargetProperty="Opacity">
                    <DoubleAnimation To="0" Duration="0:0:0.2"/>
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type v:AeroWizard}">    
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type v:AeroWizard}">
          <StackPanel Margin="-1,-2,0,0" Background="Transparent">
            <StackPanel Height="37" Orientation="Horizontal" VerticalAlignment="Top">
              <Button VerticalAlignment="Top" Width="29" Margin="0,5,0,2" Name="BackButton" Command="BrowseBack" Style="{StaticResource BackButtonStyle}"/>
              <Image VerticalAlignment="Top" Name="ico" Margin="7,2,7,2" Source="{TemplateBinding Glyph}"/>
              <TextBlock TextAlignment="Center" VerticalAlignment="Center" Foreground="#000000" FontFamily="Segoe UI" FontSize="12" Text="{TemplateBinding Title}">
                <TextBlock.BitmapEffect>
                  <OuterGlowBitmapEffect GlowColor="White" GlowSize="7"/>
                </TextBlock.BitmapEffect>
              </TextBlock>
            </StackPanel>
            <Border BorderBrush="Black" BorderThickness="1" Margin="0,1,-1,0" CornerRadius="2"> 
              <StackPanel x:Name="clientArea" Background="White">
              <Grid Name="Header">
                <TextBlock Margin="38,19,38,19" FontFamily="Segoe UI Regular" TextWrapping="Wrap" Text="{TemplateBinding MainInstruction}" FontSize="16" Foreground="#1370AB"/>
              </Grid>
              <ContentPresenter Content="{TemplateBinding ContentArea}" HorizontalAlignment="Left" Margin="38,19,38,19" Width="555" Height="286"  />
              <Grid Background="#F5F5F5" Name="CommandArea">
                <Line X1="0" X2="{Binding ElementName=CommandArea, Path=ActualWidth}" Y1="0" Y2="0" Stroke="Gray" StrokeThickness="1"/>
                <DockPanel LastChildFill="False" Margin="0,14,19,14" Name="Commands">
                  <Button Padding="12,0,12,0" VerticalAlignment="Center" Margin="7,0,0,0" DockPanel.Dock="Right" Content="Cancel"/>
                  <Button Visibility="Hidden" DockPanel.Dock="Right" Content="Next"/>
                </DockPanel>
              </Grid>
              </StackPanel>
            </Border>
          </StackPanel>
          <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=ContentArea.CanGoBack, RelativeSource={RelativeSource Self}}" Value="True">
              <Setter Property="Button.IsEnabled" Value="True" TargetName="BackButton" />
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=ContentArea.CanGoBack, RelativeSource={RelativeSource Self}}" Value="False">
              <Setter Property="Button.IsEnabled" Value="False" TargetName="BackButton" />
            </DataTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="WindowStyle" Value="SingleBorderWindow"/>
    <!--<Setter Property="Icon" Value="pack://application:,,,/None.ico"/>-->
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Width" Value="620"/>
    <Setter Property="Height" Value="489"/>
    <Setter Property="WindowState" Value="Minimized"/>
    <Setter Property="ResizeMode" Value="CanMinimize"/>
  </Style>
</ResourceDictionary>
